#! /usr/bin/env python

# Jeremy's test code.
# (scezumin)

import time
import sys
from simulation import *

map_file_name = "map3x3structure40.json"
number_of_trials = 1000
directory = "trials/"

for intensity in [1.0]:
		
	print "Beginning trials with %s millicurie source present" % intensity
	for i in range(number_of_trials):
		output_file_name = directory + "source_" + str(intensity) + \
		                   "_present" + str(i) + ".txt"
		sim = KSigmaSimulation(map_file_name,
						debug_mode=False,
						heatmapOn=True,
						visualsOn=False,
						outputfile=output_file_name)
		sim.emitters[0].intensity = intensity
		sim.run()
		if (i % 10) == 9:
			sys.stderr.write('.')
		if (i % 1000) == 999:
			sys.stderr.write('\n')
		

print "Beginning trials with source absent"
for i in range(number_of_trials):
	output_file_name = directory + "source_absent" + str(i) + ".txt"
	sim = KSigmaSimulation(map_file_name,
					debug_mode=False,
					heatmapOn=True,
					visualsOn=False,
					outputfile=output_file_name)
	# manually remove emitters from field
	sim.emitters = {}
	sim.run()
	if (i % 10) == 9:
		sys.stderr.write('.')
	if (i % 1000) == 999:
		sys.stderr.write('\n')
